<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="UTF-8">
        <meta name="csrf-token" content="{{ csrf_token() }}">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">	
        <link rel="shortcut icon" type="image/x-icon" href="{{URL::asset('handan/images/logo-icon.png')}}" />
        <title>订阅管理</title>
        <link rel="stylesheet" href="{{URL::asset('mobile/css/public.css') }}"/>
        <link rel="stylesheet" href="{{URL::asset('mobile/css/management.css') }}"/>
		<script src="{{URL::asset('mobile/js/management.js') }}"></script>
    </head>
    <script>
    	var listurl       = '{{ url("/gendanlist") }}';
  		var analyst_tel   = '{{ $info[0]->tel }}';
    </script>
<body>
	<div class="tab_btn">
		<div class="tab_box">
			<div class="tab_box_nav">
				<ul class="tab_ul">
					<li class="cur"><a href="javascript:;" target="_blank">正在订阅</a></li>
					<li><a href="javascript:;" target="_blank">订阅历史</a></li>
				</ul>
			</div>
			<div class="tab_box_list">
				<div class="tab_list tab_list_show">
					<ul cate="100">
						<li>
							@if($mefollowdata)
							    @foreach($mefollowdata as $key=>$val)
								<section>
									<div class="name_info">
										<div class="photo">
											<img src="@if($val->photo) {{$val->photo}} @else {{URL::asset('/handan/images/photo.png')}} @endif " alt="">
										</div>
										<div class="name">
											<p class="managementname">{{$val->username}}</p>
											<p>@if($val->direction == 0) 正向订阅 @else 反向订阅 @endif</p>
										</div>
										<div class="bonus">
											<p>{{round($val->final_point,2)}}</p>
											<p>订阅收益</p>
										</div>
									</div>
									<div class="follow_info">
										<div class="time">
											<p>订阅时间:</p>
											<p>
												{{date('Y-m-d H:i:s',$val->follow_time)}}
											</p>
										</div>
										@if($isself)
										<div class="edit" onclick="gendan(this);" analyst_id="{{$val->analyst_id}}" analyst_username="{{$val->analyst_name}}" status="{{$val->status}}" direction="{{$val->direction}}">
											<p></p>
											<p>编辑</p>
										</div>
										@endif
									</div>
								</section>
								@endforeach
						    @else
						        <section style="text-align: center;color: #30353C;line-height: 16rem;border: none; background: transparent;">您还未订阅任何分析师</section>
						    @endif
						    
						    <!--订阅按钮弹层-->
							<div class="follow_btn" id="follow_btn">
								<div>
									<div class="bor">
										<span myAttr = '0' class=""></span>
									</div>
									正向订阅
								</div>
								<div></div>
								<div>
									<div class="bor">
										<span myAttr = '1' class=""></span>
									</div>
									反向订阅
								</div>
								<div>
									<div class="squar">
								       <input type="checkbox" value="None" id="squar" name="check" />
								       <label for="squar" id="squar">
								       		<span></span>
								       </label>
								    </div>
									<span>我已阅读并同意<a href="{{url('/agree')}}">《订阅协议》</a></span>
								</div>
								<div>
									<span onclick="cancle();">取消</span>
									<span onclick="sure(this);">确定</span>
								</div>
								<!--取消订阅-->
								<div class="cancel_follow" id="gendancancle" onclick="follow(0,0,this);">
									取消订阅
								</div>
							</div>
						</li>									
					</ul>
				</div>
				<div class="tab_list">
					<ul cate="100">
						<li>
							<!-- 排序 -->
							<div class="oderby">
							    <div>
							        <span>按类型</span>
							        &nbsp;
							        <span class="zheng">全部 <img src="{{ URL::asset('mobile/image/analystcenter/s.png') }}"></span>
							    </div>
							    <div>
							        <span>按盈亏</span>
							        &nbsp;
							        <span class="ying">全部 <img src="{{ URL::asset('mobile/image/analystcenter/s.png') }}"></span>
							    </div>
							</div>
							<!-- 排序盒子 -->
							<div class="j_box j_box_one">
							    <div onclick="handanlist(0,select_dealtype,this,1)" class="q">全部<img src="{{ URL::asset('mobile/image/analystcenter/duihao.png') }}"></div>
							    <div onclick="handanlist(1,select_dealtype,this,1)" class="z">正向</div>
							    <div onclick="handanlist(2,select_dealtype,this,1)" class="f">反向</div>
							</div>
							<div class="j_box j_box_two">
							    <div onclick="handanlist(select_type,0,this,2)" class="qy">全&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;部<img src="{{ URL::asset('mobile/image/analystcenter/duihao.png') }}"></div>
							    <div onclick="handanlist(select_type,1,this,2)" class="y">盈利交易</div>
							    <div onclick="handanlist(select_type,2,this,2)" class="k">亏损交易 </div>
							</div>
							<!-- 列表 -->
							@include('mobile.gendanlist')
						</li>								
					</ul>
				</div>
			</div>
		</div>
	</div>
	<!--提示框-->
	<div class="mask"></div>
	<div class="l_tips"></div>
</body>
</html>
<style type="text/css">
	.page {
		z-index: 1;
	}
	.page-group{
	  height:83%;
	  top:4.5rem;
	}
	.list-block ul{
		background: #f6f6f6;
	}
	.list-block ul li{
		background: #fff;
	}
</style>
<script>
	var bdlists = "{{ url('/bdlists') }}";
	var aid       = 0;
    var analyst_username = '';
    var gotofllow = "{{url('/fllow')}}";
    var status    = 3;//是否订阅
    var direction = 3;//订阅方向
    var gotologin = "{{url('/mlogin')}}";
    $('.ying').click(function(){
      	$('.j_box_two').show();
      	$('.j_box_one').hide();
    });
  	$('.zheng').click(function(){
      	$('.j_box_one').show();
      	$('.j_box_two').hide();
  	});
	//选择正向、反向订阅
	$('.follow_btn .bor span').click(function() {
		$(this).attr({'class':'current'}).parents('div').siblings().find('span').attr({'class':''});
		direction = $(this).attr({'class':'current'}).attr('myAttr');
	})
	//tab切换
	$('.tab_ul li').click(function(){
		var ul_num = $(this).index();
		$('.tab_ul li').removeClass('cur');
		$(this).addClass('cur');
		$('.tab_list').eq(ul_num).show().siblings().hide();
	})
</script>
